import { request } from '@/utils/request';

// 查询租户套餐列表
export function listTenantPackage(query: any) {
  return request.get({
    url: '/system/tenant/package/list',  // 保持正确的路径
    params: query,
  });
}

// 查询租户套餐详细
export function getTenantPackage(packageId: number) {
  return request.get({
    url: `/system/tenantApp/${packageId}`,
  });
}

// 新增租户套餐
export function addTenantPackage(data: any) {
  return request.post({
    url: '/system/tenantApp',
    data,
  });
}

// 修改租户套餐
export function updateTenantPackage(data: any) {
  return request.put({
    url: '/system/tenantApp',
    data,
  });
}

// 删除租户套餐
export function delTenantPackage(packageId: number | number[]) {
  return request.delete({
    url: `/system/tenantApp/${packageId}`,
  });
}

// 查询租户套餐下拉列表
export function selectTenantPackage() {
  return request.get({
    url: '/system/tenantApp/selectList',
  });
}

// 根据租户套餐ID查询菜单树结构
export function tenantPackageMenuTreeSelect(packageId: number) {
  return request.get({
    url: `/system/tenantApp/menuTreeSelect/${packageId}`,
  });
}

